Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support invoking current-version goal via cli #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wade-taylor
Copy link

Update the plugin to allow the following:

mvn \
  net.stickycode.plugins:bounds-maven-plugin:current-version \
  -Dartifact='org.apache.commons:commons-lang3:[3,4)'

This is convenient when you want to quickly see what version will be resolved for an artifact and version range.

Comment on lines +38 to +43
/**
* Useful when using the maven cli to look up the current version of a single artifact. Version range is
* supported since the property is not split into a list.
*/
@Parameter(required = false, property = "artifact")
private String artifact;
Copy link
Author

@wade-taylor wade-taylor Jul 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding a parameter for a singular artifact allows you to get around maven mis-interpreting the comma in a version range.

For comparison, we could change the artifacts parameter to:

@Parameter(required=false, property="artifacts")
private List<String> artifacts;

which would allow us to set it on the command line via

-Dartifacts=org.apache.commons:commons-lang3:[3,4)

However, maven will mangle the comma in the version range and interpret this a 2 artifacts:

  1. org.apache.commons:commons-lang3:[3
  2. 4)
    which obviously is not what's intended.

@fredcooke fredcooke requested a review from stickycode July 17, 2023 10:22
Copy link
Contributor

@fredcooke fredcooke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will leave it to Mike to approve but LGTM and good change - thanks :-)

@stickycode
Copy link
Member

Yeah good change, I'll just tweak some formatting and merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants